home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 1997 #1
/
Amiga Plus CD - 1997 - No. 01.iso
/
pd
/
programmierung
/
mesa-1.2.8
/
mklib.linux
< prev
next >
Wrap
Text File
|
1996-05-27
|
1KB
|
49 lines
#!/bin/sh
# Make a Linux ELF shared library
# First argument is name of output library
# Rest of arguments are object files
LIBRARY=$1
shift 1
OBJECTS=$*
# the following provided by Thomas Hiller (Hiller@tu-harburg.d400.de)
LIBMAJOR=1
LIBMINOR=2
LIBTINY=8
VERSION="${LIBMAJOR}.${LIBMINOR}.${LIBTINY}"
LIBNAME=`basename $LIBRARY`
ARNAME=`basename $LIBNAME .so`.a
DIRNAME=`dirname $LIBRARY`
gcc -shared -Wl,-soname,${LIBNAME}.${LIBMAJOR} -o ${LIBRARY}.${VERSION} ${OBJECTS}
(cd $DIRNAME; ln -s ${LIBNAME}.${VERSION} ${LIBNAME}.${LIBMAJOR})
ln -s ${LIBNAME}.${LIBMAJOR} ${LIBRARY}
# also make regular .a files,
# provided by Danek Duvall (duvall@dhduvall.student.princeton.edu)
ar cq ${DIRNAME}/${ARNAME} ${OBJECTS}
ranlib ${DIRNAME}/${ARNAME}
# Print a reminder about shared libs:
DIR=`cd .. ; pwd`
echo
echo "******Be sure to add" ${DIR}"/lib to your LD_LIBRARY_PATH variable"
echo
sleep 2
#### NOTES:
# One Mesa user reports having to run the "ldconfig -v" command to make
# Linux aware of the shared libs.